package cn.seqdata.forecast.model.smoothing;

import cn.seqdata.forecast.model.AbstractModel;
import cn.seqdata.forecast.model.ModelParams;
import org.hawkular.datamining.forecast.AutomaticForecaster;
import org.hawkular.datamining.forecast.models.Model;
import org.hawkular.datamining.forecast.models.SimpleExponentialSmoothing;

public class SimpleExponentialSmoothingModel extends ExponentialSmoothingModel {

    @Override
    public AbstractModel<ModelParams> create(ModelParams params) {
        SimpleExponentialSmoothingModel model = new SimpleExponentialSmoothingModel();

        model.create(Model.SimpleExponentialSmoothing, params);

        SimpleExponentialSmoothing usedModel = SimpleExponentialSmoothing.createWithSmoothingParam(params.getDouble("levelSmoothing"));
        model.setForecaster(new AutomaticForecaster(context, config, usedModel));

        return model;
    }
}
